# Maintainer: Willow Barraco <contact@willowbarraco.fr>
pkgname=openapi-validator
pkgver=1.19.2
pkgrel=0
pkgdesc="Configurable and extensible validator/linter for OpenAPI documents"
url="https://github.com/IBM/openapi-validator"
license="Apache-2.0"
arch="noarch"
makedepends="npm"
depends="nodejs"
source="https://registry.npmjs.org/ibm-openapi-validator/-/ibm-openapi-validator-$pkgver.tgz"
options="!check" # no test suite
builddir="$srcdir/package"

unpack() {
	# skipping unpacking, installing archive directly
	verify
}

package() {
	npm install -g --user root --prefix "$pkgdir/usr" "$srcdir/ibm-openapi-validator-$pkgver.tgz"
	find "$pkgdir/usr/lib/node_modules/root" -delete
	chown -R root: "$pkgdir" # npm installs as build user
}
sha512sums="
4817ded577eda29982b744be18d05c144ccfd1cda674563e7cecb2d4b9cdee712ba013c044ecee4dbed6a5340242fa1c21480d00bf135a9c0e990dd1827857ab  ibm-openapi-validator-1.19.2.tgz
"
